package com.abocode.aichat.app.configuration;

import com.abocode.aichat.app.auth.AuthInterceptor;
import com.abocode.aichat.app.auth.AuthUnloginInterceptor;
import com.abocode.aichat.app.vo.HttpHelper;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.multipart.MultipartResolver;
import org.springframework.web.multipart.commons.CommonsMultipartResolver;

/**
 * Created by guanxf on 2015/12/16.
 */
@Configuration
public class AppConfiguration {
    @Bean
    public HttpHelper httpHelper() {
        return new HttpHelper();
    }

    @Bean
    public AuthUnloginInterceptor authUnloginInterceptor() {
        return new AuthUnloginInterceptor();
    }

    @Bean
    public AuthInterceptor authInterceptor() {
        return new AuthInterceptor();
    }



  /*  @Bean
    public MultipartConfigElement multipartConfigElement() {
        MultiPartConfigFactory factory = new MultiPartConfigFactory();
        factory.setMaxFileSize("1024KB");
        factory.setMaxRequestSize("1024KB");
        return factory.createMultipartConfig();
    }*/

   @Bean
   public MultipartResolver multipartResolver() {
       return new CommonsMultipartResolver();
   }
}
